home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 1 / Amiga Tools.iso / wb-tools / toolmanager / source / library / tmhandle.c < prev    next >
C/C++ Source or Header  |  1994-06-06  |  840b  |  43 lines

  1. /*
  2.  * tmhandle.c  V2.1
  3.  *
  4.  * TMHandle managment routines
  5.  *
  6.  * (c) 1990-1993 Stefan Becker
  7.  */
  8.  
  9. #include "ToolManagerLib.h"
  10.  
  11. /* Allocate a TMHandle */
  12. BOOL InternalAllocTMHandle(struct TMHandle *handle)
  13. {
  14.  int i;
  15.  
  16.  DEBUG_PRINTF("InternalAllocTMHandle(%08lx) called.\n",handle);
  17.  
  18.  /* Init list structures */
  19.  for (i=0; i<TMOBJTYPES; i++) NewList(&handle->tmh_ObjectLists[i]);
  20.  
  21.  return(TRUE);
  22. }
  23.  
  24. /* Free a TMHandle */
  25. BOOL InternalFreeTMHandle(struct TMHandle *handle)
  26. {
  27.  int i;
  28.  
  29.  DEBUG_PRINTF("InternalFreeTMHandle(%08lx) called.\n",handle);
  30.  
  31.  /* Remove objects from lists */
  32.  for (i=TMOBJTYPES-1; i>=0; i--) {
  33.   /* Remove objects from one list */
  34.   struct List    *tmol=&handle->tmh_ObjectLists[i];
  35.   struct TMObect *tmobj;
  36.  
  37.   /* Scan list and delete objects */
  38.   while (tmobj=GetHead(tmol)) CallDeleteTMObject(tmobj);
  39.  }
  40.  
  41.  return(TRUE);
  42. }
  43.